package org.csu.springjpetstore.persistence;


import org.csu.springjpetstore.domain.Item;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

@Repository
public interface ItemDAO {
    /**
     * description 更新存货item剩余量
     *
     * @param param: <键(名字),值> itemId:商品id itemQuantity:减少的数量
     * @author huangzhangyan
     * @date 2021/10/31 18:36
     */
    void updateInventoryQuantity(Map<String, Object> param);

    /**
     * description 获得存货剩余量
     *
     * @param itemId:
     * @return int
     * @author huangzhangyan
     * @date 2021/10/31 18:46
     */
    int getInventoryQuantity(String itemId);


    /**
     * description 通过productId获取ItemList
     *
     * @param productId:
     * @return List<Item>
     * @author huangzhangyan
     * @date 2021/10/31 23:15
     */
    List<Item> getItemListByProduct(String productId);

    Item getItem(String itemId);
}
